package com.rylan.feign;

import com.rylan.entity.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.List;


/**
 * @author rylan
 * @description
 */
@FeignClient(value = "orderserver")
public interface OrderFeign {
    @PostMapping("/order/save")
    public void save(Order order);

    @GetMapping("/order/findAllByUid/{uid}/{index}/{limit}")
    public List<Order> findAllByUid(@PathVariable("uid") long uid, @PathVariable("index") int index, @PathVariable("limit") int limit);

    @GetMapping("/order/findAllByState/{state}/{index}/{limit}")
    public List<Order> findAllByState(@PathVariable("state") int state,@PathVariable("index") int index,@PathVariable("limit") int limit);

    @PutMapping("/order/updateState/{id}/{state}/{aid}")
    public void updateState(@PathVariable("id") long id, @PathVariable("state") int state, @PathVariable("aid") long aid);
}
